package com.hd.trans.camerax

import android.graphics.Point

class ScanResult(
    var code: Int = CODE_SEARCH_ING,
    var scanImageWidth: Int = 1,
    var scanImageHeight: Int = 1,
    var data: Array<Point>? = null,
) {
    companion object {
        const val CODE_SUCCESS = 1

        //搜索文档中，scan的结果是全图片
        const val CODE_SEARCH_ING = 2

        //匹配中
        const val CODE_FIX_ING = 3

        //忽略掉的
        const val CODE_IGNORE = 4

        const val CODE_OVER = 5
    }


    fun isSuccess(): Boolean {
        return code == CODE_SUCCESS
    }


    fun getPoints(): Array<Point>? {
        return if (code == CODE_SEARCH_ING) null else data
    }

}